#!/bin/bash
read -p "localhost name : " UNAME
read -p "password : " PSD
a=$(cat loginerr.log)
b=${#a}
if [[ $UNAME = "tom" && $PSD = "tom" ]]
then
    echo "Wellcome!"
    echo $(date) $(uname -r)
    if [ b != 0 ]
    then
        echo $(cat loginerr.log)
    fi
    printf "" > loginerr.log
else
    echo "Login Incorrect"
fi
printf "$(date) $(uname -r)\n" >> loginerr.log
